import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const UserId = 'Admin-userId'

const ExpiresInKey = 'Admin-Expires-In'
const UserName = 'Admin-userName'

const UserAvatar = 'Admin-userAvatar'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getExpiresIn() {
  return Cookies.get(ExpiresInKey) || -1
}

export function setExpiresIn(time) {
  return Cookies.set(ExpiresInKey, time)
}

export function removeExpiresIn() {
  return Cookies.remove(ExpiresInKey)
}

export function getUserId() {
  return Cookies.get(UserId)
}

export function setUserId(userId) {
  return Cookies.set(UserId, userId)
}

export function removeUserId() {
  return Cookies.remove(UserId)
}

export function getUserName() {
  return Cookies.get(UserName)
}

export function setUserName(userName) {
  return Cookies.set(UserName, userName)
}

export function removeUserName() {
  return Cookies.remove(UserName)
}

export function getUserAvatar() {
  return Cookies.get(UserAvatar)
}

export function setUserAvatar(userAvatar) {
  return Cookies.set(UserAvatar, userAvatar)
}

export function removeUserAvatar() {
  return Cookies.remove(UserAvatar)
}